<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>风险管理和隐患排查治理工具箱</title>
    <script src="./layui/layui.js"></script>
    <script src="./jquery-3.6.0.min.js"></script>
    <!-- <script src="./common.js"></script> -->
    <link rel="stylesheet" href="./layui/css/layui.css">
    <link rel="stylesheet" href="./css/font-awesome.min.css">
    <link rel="stylesheet" href="./css/style.css">
</head>
<body>
    <div class="container">
        <img class="logo" src="./images/logo.png" alt="logo">
        <h3>风险管理和隐患排查治理工具箱</h3>
        <i class="fa fa-spinner fa-spin"></i>
        <div class="loginBox">
            <p>正在在加载中,请稍后....</p>
        </div>
    </div>
</body>
</html>

<script>
$(function () {
    setTimeout(function () {
        var html = '<a href="javascript:;" class="btn" onclick="openIndex()">进入工具箱</a>'
        $('.loginBox').html(html)
    }, 3000);
})


const { ipcRenderer } = require('electron')

function openIndex() {
    //同步
    // window.addEventListener("DOMContentLoaded", () => {
    //     const msg = ipcRenderer.sendSync("messageSync", '这是想主线程main.js同步发送的值');
    //     //   console.log(msg);  //这是同步接受到main.js返回的值。
    // })
    //异步
    ipcRenderer.send("openPage", 'index');

}

// 接收主线程返回的信息
ipcRenderer.on("returnOpenPage", (e, val) => {
    console.log(val)
})

</script>